
let p = new Promise((resolve,reject)=>{
  // resolve('hello world');
  reject('hello')
})

let result = p.then(success=>{
  console.log('success--',success);
  // throw 'throw--123'
  // return 'success-123'
  return new Promise((resolve,reject)=>{
    // resolve('hahaha')
    reject('reject-hahaha')
  })
},error=>{
  console.log('error--',error);
})
console.log('result--',result);


// [[Prototype]]: Promise
// [[PromiseState]]: "rejected"
// [[PromiseResult]]: "throw--123"
// success-- hello world

// [[Prototype]]: Promise
// [[PromiseState]]: "fulfilled"
// [[PromiseResult]]: "success-123"
// success-- hello world

// [[Prototype]]: Promise
// [[PromiseState]]: "fulfilled"
// [[PromiseResult]]: "hahaha"
// success-- hello world

// [[Prototype]]: Promise
// [[PromiseState]]: "rejected"
// [[PromiseResult]]: "reject-hahaha"
// success-- hello world


